
option explicit

' ------------------------------------------------------------------------------
' ------------------------------------------------------------------------------
' --- Quebla - View Order Library - Version 1.0.0
' --- Autor:    Sardi, Leandro Daniel
' --- Mail:     lsardi@quebla.com.ar
' --- Fecha:    2006/06/05
' ---
' --- Copyright Quebla (c). Todos los derechos reservados
' ---

class COrderHnd

    private m_oColumnHnd
    private m_bAscending


    public sub Initialize()
        set m_oColumnHnd = nothing
        m_bAscending = false
    end sub
    
    
    public property get oColumnHnd()
        set oColumnHnd = m_oColumnHnd
    end property

    public property set oColumnHnd(byval o)
        set m_oColumnHnd = o
    end property


    public property get bAscending()
        bAscending = m_bAscending
    end property

    public property let bAscending(byval b)
        m_bAscending = b
    end property


    public function GetExpresion()
        dim sRes
        
        sRes = m_oColumnHnd.sExpresionForOrder()
        
        if me.bAscending then
            sRes = sRes & " ASC"
        else
            sRes = sRes & " DESC"
        end if
        
        GetExpresion = sRes
    end function

end class
